#include<iostream>
#include<stdio.h>

using namespace std;
const int upTime = 6;
const int downTime = 4;
const int stopTime = 5;
int main(void)
{
    int N;
    cin>>N;
    int totTime = 0;
    int preFloor = 0;
    for(int i = 0; i < N; i++) {
        int floor;
        cin>>floor;
        if(floor > preFloor) {
            totTime += (floor-preFloor)*upTime;
        }
        else if(floor < preFloor) {
            totTime += (preFloor-floor)*downTime;
        }
        totTime += stopTime;
        preFloor = floor;
    }
    printf("%d\n",totTime);
    return 0;
}